package com.sservice.service.service;

import com.sservice.urp.entity.User;
import com.sservice.urp.entity.UserRole;
import com.sservice.urp.vo.UserVo;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

public interface IUserService {
    User queryUserByPhone(String phone);

    /**
     * 获取登录用户
     *
     * @param request
     * @return
     */
    UserVo getLoginedUser(HttpServletRequest request);

    /**
     * 是否市司法局管理平台层面
     *
     * @return
     */
    boolean isShiAdminLevel(User u);

    boolean isShiAdminLevel(UserVo u);

    boolean isShiAdminLevel(String comId);


    /**
     * 获取登录用户信息
     *
     * @param user
     * @return
     */
    UserVo queryUserByPhoneOrUserName(User user);

    List<User> queryPlainByPage(UserVo user);

    /**
     * 纯数据统计
     *
     * @param user
     * @return
     */
    int countPlainByPage(UserVo user);

    /**
     * 分页查询:关键字，手机号、字段升降序、每页显示大小，某一页
     * 默认进行每页15个显示
     *
     * @param user
     * @return
     */
    List<User> queryByPage(UserVo user);
   int countByPage(UserVo user);

    int queryCount(UserVo user);

    int queryCountByComId(UserVo user);

    int queryCountByDepId(UserVo user);

    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(User record);

    int deleteByUserId(Integer userid);

    int addBatch(List<UserRole> list);

    /**
     * 通过用户ID 获取部门fax as dep_name,tel as com_name
     *
     * @param record
     * @return
     */
    User selectDepByPrimaryKey(User record);



    /**
     * 通过关系对数据进行查询
     *
     * @param user
     * @return
     */
    List<UserVo> queryPlainWithDr(UserVo user);

    /**
     * 通过关系对数据进行统计
     *
     * @param user
     * @return
     */
    int countPlainWithDr(UserVo user);

}
